home *** CD-ROM | disk | FTP | other *** search
- {(C) 1996 Pijl Computer Services Ltd. Check laptop power situation}
- Unit Power;
- Interface
- Function PowerMan:Integer;
- Implementation
- Function PowerMan:Integer;
- Var
- Fault,Batt,Life:Byte;
- begin
- asm
- mov fault,00h
- mov ax,5300h
- mov bx,0000h
- int 15h
- jc @err
- mov ax,530ah
- mov bx,0001h
- int 15h
- mov batt,bl
- mov life,cl
- jc @err
- jmp @done
- @err: mov fault,AH
- @done: nop
- end;
- If (Fault=0) aAnd (Life in [0..100]) then
- PowerMan := Life
- else
- PowerMan := -1;
- end;
- end.